package com.huluobo.base.net

import com.huluobo.base.bean.CommentBeanResult
import com.huluobo.base.bean.FollowBeanResult
import com.huluobo.base.bean.LikeBeanResult
import com.huluobo.base.bean.UserBeanResult
import com.huluobo.base.bean.VideoBeanResult
import io.reactivex.Observable
import okhttp3.RequestBody
import retrofit2.http.Body
import retrofit2.http.GET
import retrofit2.http.POST
import retrofit2.http.Query

/**
 *  Created by LC on 2024/6/12.
 */
interface ApiService {
    @POST(Const.URL_LOGIN)
    fun login(@Body body: RequestBody): Observable<UserBeanResult>

    @GET(Const.URL_GET_VIDEO_LIST)
    fun getVideoList(
        @Query(Const.PARAM_CURRENT_PAGE) currentPage: Int,
        @Query(Const.PARAM_PAGE_SIZE) pageSize: Int
    ): Observable<VideoBeanResult>

    @POST(Const.URL_LIKE)
    fun likeVideo(@Query(Const.PARAM_VIDEO_ID) videoId: Int): Observable<LikeBeanResult>

    @POST(Const.URL_NO_LIKE)
    fun noLikeVideo(@Query(Const.PARAM_VIDEO_ID) videoId: Int): Observable<LikeBeanResult>

    @POST(Const.URL_FOLLOW)
    fun followAuth(@Body body: RequestBody): Observable<FollowBeanResult>

    @GET(Const.URL_GET_COMMENT_LIST)
    fun getCommentList(@Query(Const.PARAM_VIDEO_ID) videoId: Int): Observable<CommentBeanResult>

    @POST(Const.URL_SEND_COMMENT)
    fun sendComment(@Body requestBody: RequestBody): Observable<CommentBeanResult>
}